<template>
  <span v-if="content">
    <a-badge v-if="content.badge" v-bind="content.badge" :text="content.text" :color="content.color" />
    <template v-else>
      <span v-if="content.color" :style="{color:content.color}">{{content.text}}</span>
      <span v-else>{{content.text}}</span>
    </template>
  </span>
</template>

<script>
export default {
  name: 'SjhtState',
  props: {
    list: {
      type: Array,
      required: true
    },
    value: [String, Number]
  },
  computed: {
    content: function () {
      return this.list.find(f => f.value == this.value)
    }
  }
}
</script>